#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = 1e5 + 5;
const int M = 998244353;

int n;
int a[N], dp[N][11];

int main()
{
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0);
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }

    dp[1][a[1]] = 1;
    for (int i = 2; i <= n; i++) {
        for (int j = 0; j <= 9; j++) {
            int f = (j+a[i]) % 10;
            int g = (j*a[i]) % 10;
            dp[i][f] = (dp[i][f] + dp[i-1][j]) % M;
            dp[i][g] = (dp[i][g] + dp[i-1][j]) % M;
        }
    }
    for (int i = 0; i <= 9; i++) cout << dp[n][i] << endl;
    return 0;
}